home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / Python 1.3 PPC / Tools / bgen / ae / Finder_Standard_Suite.py < prev    next >
Encoding:
Python Source  |  1995-10-11  |  14.8 KB  |  473 lines  |  [TEXT/PYTH]

  1. """Suite Standard Suite: Common terms for most applications
  2. Level 1, version 1
  3.  
  4. Generated from Moes:System folder:Extensions:Finder Scripting Extension
  5. AETE/AEUT resource version 0/144, language 0, script 0
  6. """
  7.  
  8. import addpack
  9. addpack.addpack('Tools')
  10. addpack.addpack('bgen')
  11. addpack.addpack('ae')
  12.  
  13. import aetools
  14. import MacOS
  15.  
  16. _code = 'core'
  17.  
  18. class Standard_Suite:
  19.  
  20.     _argmap_class_info = {
  21.         '_in' : 'wrcd',
  22.     }
  23.  
  24.     def class_info(self, _object=None, _attributes={}, **_arguments):
  25.         """class info: Get information about an object class
  26.         Required argument: the object class about which information is requested
  27.         Keyword argument _in: the human language and script system in which to return information
  28.         Keyword argument _attributes: AppleEvent attribute dictionary
  29.         Returns: a record containing the object’s properties and elements
  30.         """
  31.         _code = 'core'
  32.         _subcode = 'qobj'
  33.  
  34.         _arguments['----'] = _object
  35.  
  36.         aetools.keysubst(_arguments, self._argmap_class_info)
  37.  
  38.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  39.                 _arguments, _attributes)
  40.         if _arguments.has_key('errn'):
  41.             raise MacOS.Error, aetools.decodeerror(_arguments)
  42.         # XXXX Optionally decode result
  43.         if _arguments.has_key('----'):
  44.             return _arguments['----']
  45.  
  46.     _argmap_close = {
  47.         'saving' : 'savo',
  48.         'saving_in' : 'kfil',
  49.     }
  50.  
  51.     def close(self, _object, _attributes={}, **_arguments):
  52.         """close: Close an object
  53.         Required argument: the object to close
  54.         Keyword argument saving: specifies whether changes should be saved before closing
  55.         Keyword argument saving_in: the file in which to save the object
  56.         Keyword argument _attributes: AppleEvent attribute dictionary
  57.         """
  58.         _code = 'core'
  59.         _subcode = 'clos'
  60.  
  61.         _arguments['----'] = _object
  62.  
  63.         aetools.keysubst(_arguments, self._argmap_close)
  64.         aetools.enumsubst(_arguments, 'savo', _Enum_savo)
  65.  
  66.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  67.                 _arguments, _attributes)
  68.         if _arguments.has_key('errn'):
  69.             raise MacOS.Error, aetools.decodeerror(_arguments)
  70.         # XXXX Optionally decode result
  71.         if _arguments.has_key('----'):
  72.             return _arguments['----']
  73.  
  74.     _argmap_count = {
  75.         'each' : 'kocl',
  76.     }
  77.  
  78.     def count(self, _object, _attributes={}, **_arguments):
  79.         """count: Return the number of elements of a particular class within an object
  80.         Required argument: the object whose elements are to be counted
  81.         Keyword argument each: the class of the elements to be counted
  82.         Keyword argument _attributes: AppleEvent attribute dictionary
  83.         Returns: the number of elements
  84.         """
  85.         _code = 'core'
  86.         _subcode = 'cnte'
  87.  
  88.         _arguments['----'] = _object
  89.  
  90.         aetools.keysubst(_arguments, self._argmap_count)
  91.  
  92.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  93.                 _arguments, _attributes)
  94.         if _arguments.has_key('errn'):
  95.             raise MacOS.Error, aetools.decodeerror(_arguments)
  96.         # XXXX Optionally decode result
  97.         if _arguments.has_key('----'):
  98.             return _arguments['----']
  99.  
  100.     _argmap_data_size = {
  101.         'as' : 'rtyp',
  102.     }
  103.  
  104.     def data_size(self, _object, _attributes={}, **_arguments):
  105.         """data size: Return the size in bytes of an object
  106.         Required argument: the object whose data size is to be returned
  107.         Keyword argument as: the data type for which the size is calculated
  108.         Keyword argument _attributes: AppleEvent attribute dictionary
  109.         Returns: the size of the object in bytes
  110.         """
  111.         _code = 'core'
  112.         _subcode = 'dsiz'
  113.  
  114.         _arguments['----'] = _object
  115.  
  116.         aetools.keysubst(_arguments, self._argmap_data_size)
  117.  
  118.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  119.                 _arguments, _attributes)
  120.         if _arguments.has_key('errn'):
  121.             raise MacOS.Error, aetools.decodeerror(_arguments)
  122.         # XXXX Optionally decode result
  123.         if _arguments.has_key('----'):
  124.             return _arguments['----']
  125.  
  126.     def delete(self, _object, _attributes={}, **_arguments):
  127.         """delete: Delete an element from an object
  128.         Required argument: the element to delete
  129.         Keyword argument _attributes: AppleEvent attribute dictionary
  130.         """
  131.         _code = 'core'
  132.         _subcode = 'delo'
  133.  
  134.         _arguments['----'] = _object
  135.  
  136.         if _arguments: raise TypeError, 'No optional args expected'
  137.  
  138.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  139.                 _arguments, _attributes)
  140.         if _arguments.has_key('errn'):
  141.             raise MacOS.Error, aetools.decodeerror(_arguments)
  142.         # XXXX Optionally decode result
  143.         if _arguments.has_key('----'):
  144.             return _arguments['----']
  145.  
  146.     _argmap_duplicate = {
  147.         'to' : 'insh',
  148.         'replacing' : 'alrp',
  149.         'positioned_at' : 'mvpl',
  150.         'items' : 'fsel',
  151.     }
  152.  
  153.     def duplicate(self, _object, _attributes={}, **_arguments):
  154.         """duplicate: Duplicate object(s)
  155.         Required argument: the object(s) to duplicate
  156.         Keyword argument to: the new location for the object(s)
  157.         Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being duplicated
  158.         Keyword argument positioned_at: Gives a list (in local window coordinates) of positions for the destination items
  159.         Keyword argument items: DO NOT USE: provided for backwards compatibility with old event suite.  Will be removed in future Finders
  160.         Keyword argument _attributes: AppleEvent attribute dictionary
  161.         Returns: to the duplicated object(s)
  162.         """
  163.         _code = 'core'
  164.         _subcode = 'clon'
  165.  
  166.         _arguments['----'] = _object
  167.  
  168.         aetools.keysubst(_arguments, self._argmap_duplicate)
  169.         aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
  170.         aetools.enumsubst(_arguments, 'mvpl', _Enum_list)
  171.  
  172.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  173.                 _arguments, _attributes)
  174.         if _arguments.has_key('errn'):
  175.             raise MacOS.Error, aetools.decodeerror(_arguments)
  176.         # XXXX Optionally decode result
  177.         if _arguments.has_key('----'):
  178.             return _arguments['----']
  179.  
  180.     _argmap_event_info = {
  181.         '_in' : 'wrcd',
  182.     }
  183.  
  184.     def event_info(self, _object, _attributes={}, **_arguments):
  185.         """event info: Get information about the Apple events in a suite
  186.         Required argument: the event class of the Apple events for which to return information
  187.         Keyword argument _in: the human language and script system in which to return information
  188.         Keyword argument _attributes: AppleEvent attribute dictionary
  189.         Returns: a record containing the events and their parameters
  190.         """
  191.         _code = 'core'
  192.         _subcode = 'gtei'
  193.  
  194.         _arguments['----'] = _object
  195.  
  196.         aetools.keysubst(_arguments, self._argmap_event_info)
  197.  
  198.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  199.                 _arguments, _attributes)
  200.         if _arguments.has_key('errn'):
  201.             raise MacOS.Error, aetools.decodeerror(_arguments)
  202.         # XXXX Optionally decode result
  203.         if _arguments.has_key('----'):
  204.             return _arguments['----']
  205.  
  206.     def exists(self, _object, _attributes={}, **_arguments):
  207.         """exists: Verify if an object exists
  208.         Required argument: the object in question
  209.         Keyword argument _attributes: AppleEvent attribute dictionary
  210.         Returns: true if it exists, false if not
  211.         """
  212.         _code = 'core'
  213.         _subcode = 'doex'
  214.  
  215.         _arguments['----'] = _object
  216.  
  217.         if _arguments: raise TypeError, 'No optional args expected'
  218.  
  219.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  220.                 _arguments, _attributes)
  221.         if _arguments.has_key('errn'):
  222.             raise MacOS.Error, aetools.decodeerror(_arguments)
  223.         # XXXX Optionally decode result
  224.         if _arguments.has_key('----'):
  225.             return _arguments['----']
  226.  
  227.     _argmap_get = {
  228.         'as' : 'rtyp',
  229.     }
  230.  
  231.     def get(self, _object, _attributes={}, **_arguments):
  232.         """get: Get the data for an object
  233.         Required argument: the object whose data is to be returned
  234.         Keyword argument as: the desired types for the data, in order of preference
  235.         Keyword argument _attributes: AppleEvent attribute dictionary
  236.         Returns: the data from the object
  237.         """
  238.         _code = 'core'
  239.         _subcode = 'getd'
  240.  
  241.         _arguments['----'] = _object
  242.  
  243.         aetools.keysubst(_arguments, self._argmap_get)
  244.  
  245.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  246.                 _arguments, _attributes)
  247.         if _arguments.has_key('errn'):
  248.             raise MacOS.Error, aetools.decodeerror(_arguments)
  249.         # XXXX Optionally decode result
  250.         if _arguments.has_key('----'):
  251.             return _arguments['----']
  252.  
  253.     _argmap_make = {
  254.         'new' : 'kocl',
  255.         'at' : 'insh',
  256.         'to' : 'to  ',
  257.         'with_data' : 'data',
  258.         'with_properties' : 'prdt',
  259.     }
  260.  
  261.     def make(self, _no_object=None, _attributes={}, **_arguments):
  262.         """make: Make a new element
  263.         Keyword argument new: the class of the new element
  264.         Keyword argument at: the location at which to insert the element
  265.         Keyword argument to: when creating an alias file, the original item to create an alias to
  266.         Keyword argument with_data: the initial data for the element
  267.         Keyword argument with_properties: the initial values for the properties of the element
  268.         Keyword argument _attributes: AppleEvent attribute dictionary
  269.         Returns: to the new object(s)
  270.         """
  271.         _code = 'core'
  272.         _subcode = 'crel'
  273.  
  274.         if _no_object != None: raise TypeError, 'No direct arg expected'
  275.  
  276.         aetools.keysubst(_arguments, self._argmap_make)
  277.  
  278.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  279.                 _arguments, _attributes)
  280.         if _arguments.has_key('errn'):
  281.             raise MacOS.Error, aetools.decodeerror(_arguments)
  282.         # XXXX Optionally decode result
  283.         if _arguments.has_key('----'):
  284.             return _arguments['----']
  285.  
  286.     _argmap_move = {
  287.         'to' : 'insh',
  288.         'replacing' : 'alrp',
  289.         'positioned_at' : 'mvpl',
  290.     }
  291.  
  292.     def move(self, _object, _attributes={}, **_arguments):
  293.         """move: Move object(s) to a new location
  294.         Required argument: the object(s) to move
  295.         Keyword argument to: the new location for the object(s)
  296.         Keyword argument replacing: Specifies whether or not to replace items in the destination that have the same name as items being moved
  297.         Keyword argument positioned_at: Gives a list (in local window coordinates) of positions for the destination items
  298.         Keyword argument _attributes: AppleEvent attribute dictionary
  299.         Returns: to the object(s) after they have been moved
  300.         """
  301.         _code = 'core'
  302.         _subcode = 'move'
  303.  
  304.         _arguments['----'] = _object
  305.  
  306.         aetools.keysubst(_arguments, self._argmap_move)
  307.         aetools.enumsubst(_arguments, 'alrp', _Enum_bool)
  308.         aetools.enumsubst(_arguments, 'mvpl', _Enum_list)
  309.  
  310.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  311.                 _arguments, _attributes)
  312.         if _arguments.has_key('errn'):
  313.             raise MacOS.Error, aetools.decodeerror(_arguments)
  314.         # XXXX Optionally decode result
  315.         if _arguments.has_key('----'):
  316.             return _arguments['----']
  317.  
  318.     _argmap_open = {
  319.         'using' : 'usin',
  320.         'items' : 'fsel',
  321.     }
  322.  
  323.     def open(self, _object, _attributes={}, **_arguments):
  324.         """open: Open the specified object(s)
  325.         Required argument: list of objects to open
  326.         Keyword argument using: the application file to open the object with
  327.         Keyword argument items: DO NOT USE: provided for backwards compatibility with old event suite.  Will be removed in future Finders
  328.         Keyword argument _attributes: AppleEvent attribute dictionary
  329.         """
  330.         _code = 'aevt'
  331.         _subcode = 'odoc'
  332.  
  333.         _arguments['----'] = _object
  334.  
  335.         aetools.keysubst(_arguments, self._argmap_open)
  336.  
  337.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  338.                 _arguments, _attributes)
  339.         if _arguments.has_key('errn'):
  340.             raise MacOS.Error, aetools.decodeerror(_arguments)
  341.         # XXXX Optionally decode result
  342.         if _arguments.has_key('----'):
  343.             return _arguments['----']
  344.  
  345.     _argmap__print = {
  346.         'items' : 'fsel',
  347.     }
  348.  
  349.     def _print(self, _object, _attributes={}, **_arguments):
  350.         """print: Print the specified object(s)
  351.         Required argument: list of objects to print
  352.         Keyword argument items: DO NOT USE: provided for backwards compatibility with old event suite.  Will be removed in future Finders
  353.         Keyword argument _attributes: AppleEvent attribute dictionary
  354.         """
  355.         _code = 'aevt'
  356.         _subcode = 'pdoc'
  357.  
  358.         _arguments['----'] = _object
  359.  
  360.         aetools.keysubst(_arguments, self._argmap__print)
  361.  
  362.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  363.                 _arguments, _attributes)
  364.         if _arguments.has_key('errn'):
  365.             raise MacOS.Error, aetools.decodeerror(_arguments)
  366.         # XXXX Optionally decode result
  367.         if _arguments.has_key('----'):
  368.             return _arguments['----']
  369.  
  370.     _argmap_quit = {
  371.         'saving' : 'savo',
  372.     }
  373.  
  374.     def quit(self, _no_object=None, _attributes={}, **_arguments):
  375.         """quit: Quit the Finder (direct parameter ignored)
  376.         Keyword argument saving: specifies whether to save currently open documents (not supported by Finder)
  377.         Keyword argument _attributes: AppleEvent attribute dictionary
  378.         """
  379.         _code = 'aevt'
  380.         _subcode = 'quit'
  381.  
  382.         if _no_object != None: raise TypeError, 'No direct arg expected'
  383.  
  384.         aetools.keysubst(_arguments, self._argmap_quit)
  385.         aetools.enumsubst(_arguments, 'savo', _Enum_savo)
  386.  
  387.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  388.                 _arguments, _attributes)
  389.         if _arguments.has_key('errn'):
  390.             raise MacOS.Error, aetools.decodeerror(_arguments)
  391.         # XXXX Optionally decode result
  392.         if _arguments.has_key('----'):
  393.             return _arguments['----']
  394.  
  395.     _argmap_save = {
  396.         '_in' : 'kfil',
  397.         'as' : 'fltp',
  398.     }
  399.  
  400.     def save(self, _object, _attributes={}, **_arguments):
  401.         """save: Save an object (Not supported by Finder)
  402.         Required argument: the object to save
  403.         Keyword argument _in: the file in which to save the object (not supported by Finder)
  404.         Keyword argument as: the file type of the document in which to save the data (not supported by Finder)
  405.         Keyword argument _attributes: AppleEvent attribute dictionary
  406.         """
  407.         _code = 'core'
  408.         _subcode = 'save'
  409.  
  410.         _arguments['----'] = _object
  411.  
  412.         aetools.keysubst(_arguments, self._argmap_save)
  413.  
  414.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  415.                 _arguments, _attributes)
  416.         if _arguments.has_key('errn'):
  417.             raise MacOS.Error, aetools.decodeerror(_arguments)
  418.         # XXXX Optionally decode result
  419.         if _arguments.has_key('----'):
  420.             return _arguments['----']
  421.  
  422.     _argmap_set = {
  423.         'to' : 'data',
  424.     }
  425.  
  426.     def set(self, _object, _attributes={}, **_arguments):
  427.         """set: Set an object's data
  428.         Required argument: the object to change
  429.         Keyword argument to: the new value
  430.         Keyword argument _attributes: AppleEvent attribute dictionary
  431.         """
  432.         _code = 'core'
  433.         _subcode = 'setd'
  434.  
  435.         _arguments['----'] = _object
  436.  
  437.         aetools.keysubst(_arguments, self._argmap_set)
  438.  
  439.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  440.                 _arguments, _attributes)
  441.         if _arguments.has_key('errn'):
  442.             raise MacOS.Error, aetools.decodeerror(_arguments)
  443.         # XXXX Optionally decode result
  444.         if _arguments.has_key('----'):
  445.             return _arguments['----']
  446.  
  447.     _argmap_suite_info = {
  448.         '_in' : 'wrcd',
  449.     }
  450.  
  451.     def suite_info(self, _object, _attributes={}, **_arguments):
  452.         """suite info: Get information about event suite(s)
  453.         Required argument: the suite for which to return information
  454.         Keyword argument _in: the human language and script system in which to return information
  455.         Keyword argument _attributes: AppleEvent attribute dictionary
  456.         Returns: a record containing the suites and their versions
  457.         """
  458.         _code = 'core'
  459.         _subcode = 'gtsi'
  460.  
  461.         _arguments['----'] = _object
  462.  
  463.         aetools.keysubst(_arguments, self._argmap_suite_info)
  464.  
  465.         _reply, _arguments, _attributes = self.send(_code, _subcode,
  466.                 _arguments, _attributes)
  467.         if _arguments.has_key('errn'):
  468.             raise MacOS.Error, aetools.decodeerror(_arguments)
  469.         # XXXX Optionally decode result
  470.         if _arguments.has_key('----'):
  471.             return _arguments['----']
  472.  
  473.